package com.finance.system.dao;

import com.finance.framework.lang.Page;
import com.finance.system.bean.pojo.User;
import com.finance.system.bean.pojo.UserRoleRel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserMapper {
  User getById(Long id);
  User getByCode(String code);
  User getByCodeWithRandom(@Param("code") String code,@Param("random") int random);
  User getByMobile(String mobile);
  List<User> listByPage(Page page);
  int add(User user);
  int delete(String id);
  int batchDel(List<String> id);
  int update(User user);
  List<UserRoleRel> getRoleRelByUserCode(String userCode);
  int batchAdd(@Param("userList") List<User> userList);
  List<UserRoleRel> getRelByCode(String code);
  int countByCode(@Param("code") String code);
  List<User> queryByCodes(@Param("codes") List<String> codes);
  User getByIdWithLock(Long id);
  String getNameByCode(String code);
}